package lhdx4;

import java.util.Scanner;

public class Zxf1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        double[] a = new double[7];
        System.out.println("裁判打分:");
        double c = 0;
        for (int i = 0; i < a.length; ) {
            double b = in.nextDouble();
            while (b < 0 || b > 10) {
                System.out.println("输入错误，重新输入：");
                b=in.nextDouble();
            }
            a[i]=b;
            c=c+b;
            i++;
        }
        double d = a[0];
        for (int i = 0; i < a.length; i++) {
            if (a[i] >= d) {
                d = a[i];
            }
        }
        double e=d;
        for (int i=0;i<a.length;i++){
            if (a[i]<=d){
                d=a[i];
            }
        }
        double m=d;
        System.out.println("最终的分是："+(c-e-m));

    }
}
